import request from '@/utils/request'

//查询约课信息
export function getCourseList(query) {
  return request({
    url: '/courseSubscribe/getCourseList',
    method: 'get',
    params: query
  })
}

//根据id获取约课信息
export function getCourseInfoById(id, venueUniqueIdentifier) {
  return request({
    url: '/courseSubscribe/getCourseInfoById?id='+id+'&venueUniqueIdentifier=' + venueUniqueIdentifier,
    method: 'get'
  })
}
//修改约课信息
export function updateCourseById(data) {
  return request({
    url: '/courseSubscribe/updateCourseById',
    method: 'put',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: data
  })
}
//添加约课信息
export function addCourse(query) {
  return request({
    url: '/courseSubscribe/addCourse',
    method: 'post',
    data: query,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
//删除约课信息
export function delCourse(id,venueUniqueIdentifier) {
  const query = {
    id,
    venueUniqueIdentifier
  }
  return request({
    url: '/courseSubscribe/delCourse',
    method: 'delete',
    params: query
  })
}
//修改课程状态
export function updateCourseStatus (id,courseStatus,venueUniqueIdentifier) {
  const data = {
    id,
    courseStatus,
    venueUniqueIdentifier
  }
  return request({
    url:'/courseSubscribe/updateCourseStatus',
    method: 'put',
    data:data
  })
}

